<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta charset="UTF-8"/>
  <title>Au+财富黄金平台隆重启幕，豪送黄金红包</title>
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
  <meta name="Description" content="Au+财富黄金平台隆重启幕，豪送黄金红包"/>
  <meta name="Keywords" content="Au+财富黄金平台隆重启幕，豪送黄金红包"/>
  <meta name="author" content="liwei"/>
  <meta name="format-detection" content="telephone=no"/>
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  <meta name="apple-mobile-web-app-status-bar-style" content="black"/>

  <link rel="stylesheet" href="../css/frozen.css">
  <script type="text/javascript" src="../js/lib/zepto.min.js"></script>
  <script type="text/javascript" src="../js/lib/mylib.js"></script>
  <script type="text/javascript" src="../js/frozen.js"></script>
  <script type="text/javascript" src="../js/template-native.js"></script>
  <title>Au+财富黄金平台隆重启幕，豪送黄金红包</title>
  <style>
    input {
      font-size: 0.9rem;
      height: 1.5rem;
      line-height: 1rem;
    }

    .ui-btn-danger:not(.disabled):not(:disabled):active,
    .ui-btn-danger.active {
      background: #fadc4d;
      border-color: #fadc4d;
      color: #f51d3a;
      -webkit-background-clip: padding-box;
      background-clip: padding-box;
      height: 34px;
      border-radius: 5px;
    }
  </style>
</head>

<body style="background:#e72c42;">
<div id='wx_logo' style='margin:0 auto;display:none;'>
  <img src='../image/icon.png'/>
</div>
<section class="ui-container" style="text-align:center">
  <img src="../img/redbg.png" width="100%">
  <div style="width: 95%;background:#d02139;margin: -10px auto 0 auto;">
    <h1 style="text-align:center;color:#fff;">
      <input id="mobile" maxlength="11" type="text" placeholder=" 请输入手机号"
             style="width: 80%;margin-top: 30px;padding:5px 0px;font-size:0.8rem;border-radius: 3px;border:0px">
    </h1>
    <h1 style="text-align:center;color:#fff;">
      <button class="ui-btn ui-btn-danger"
              style="width:80%;margin:20px auto 30px auto;background: #fadc4d;color: #f51d3a;height: 34px;border-radius: 3px;"
              onclick="get_redpack();">立即领取
      </button>
    </h1>
  </div>
  <img src="../img/redgl.png" width="95%" style="margin-top:30px">
  <h6 style="color:#fce2e6;text-align:left;margin-left:15px;line-height:24px;">1.输入手机号码领取红包，每次一次机会</h6>
  <h6 style="color:#fce2e6;text-align:left;margin-left:15px;line-height:24px;">2.下载Au+ APP完成注册，即可获得红包</h6>
  <img src="../img/my/rb_2w.jpg" width="20%" style="margin:20px auto">
  <h6 style="color:#fce2e6;">扫一扫增值您的财富</h6>
</section>
</body>

</html>
<script>
  //?token=123&ip=192.168.1.1&orderNo=123&telephone=12345678901
  function get_redpack() {
    var mobile = $('#mobile').val();
    if (mobile == '') {
      $.tips({
        content: '请输入手机号',
        stayTime: 1500,
        type: "warn"
      });
      return false;
    }
    var reg = /^1\d{10}$/g;
    if (!reg.test(mobile)) {
      $.tips({
        content: '请输入正确手机号',
        stayTime: 1500,
        type: "warn"
      });
      return false;
    }

    var redvelopeNo = GetQueryString('redvelopeNo');
    if (redvelopeNo == null || redvelopeNo == '') {
      var orderNo = localStorage.getItem('orderNo');
      $.ajax({
        url: root_path + "mycoupons/saveRedvelope",
        type: 'post',
        async: false,
        data: {
          "orderNo": orderNo
        },
        success: function (result2) {
          if (result2.code == '1') {
            $.ajax({
              url: root_path + "mycoupons/RedvelopeVo",
              type: 'post',
              async: false,
              data: {
                "redvelopeNo": result2.object.redvelopeNo,
                "mobile": mobile
              },
              success: function (result) {
                if (result.code == '1') {
                  addcookie('mobile', mobile);
                  addcookie('goldBeanNumber', result.object.goldBeanNumber);
                  RedirectUrl('more_redpack_suc.html');
                } else {
                  $.tips({
                    content: result.message,
                    stayTime: 1500,
                    type: "warn"
                  });
                }
              }
            });
          } else {
            $.tips({
              content: result2.message,
              stayTime: 1500,
              type: "warn"
            });
          }
        }
      });
    } else {
      $.ajax({
        url: root_path + "mycoupons/RedvelopeVo",
        type: 'post',
        async: false,
        data: {
          "redvelopeNo": redvelopeNo,
          "mobile": mobile
        },
        success: function (result) {
          addcookie('RedvelopeVo', result.code);
          if (result.code == '1') {
            // addcookie('mobile', mobile);
            addcookie('goldBeanNumber', result.object.goldBeanNumber);
            RedirectUrl('more_redpack_suc.html');
          } else {

            $.tips({
              content: result.message,
              stayTime: 1500,
              type: "warn"
            });
          }
        }
      });
    }
  }
  var system = {
    win: false,
    mac: false,
    xll: false
  };
  var p = navigator.platform;
  system.win = p.indexOf("Win") == 0;
  system.mac = p.indexOf("Mac") == 0;
  system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
  if (system.win || system.mac || system.xll) {
    $('body').css({width: '380px', margin: 'auto'})
  }
</script>
